#include <stdio.h>
#include <stdlib.h>
#define N 20
void main()
{
    FILE *fp;
    if((fp=fopen("E:\\my program\\test.file.txt","w"))==NULL)
    {
        printf("Failure to open the new file!");
        exit(0);
    }
    char judge;
    char str[N];
    RESTART:printf("please input a string:\n");
    gets(str);
    if(fputs(str,fp)!=0)
    {
        printf("ooops!something wrong happened!");
        exit(0);
    }
    printf("Do you want to continue input?(Y/N)");
    scanf(" %c",&judge);
    getchar();
    if(judge=='Y')
        goto RESTART;
    fclose(fp);
}
